package cn.gcyl.module.biz.dal.mysql.collect;

import cn.gcyl.framework.common.pojo.PageResult;
import cn.gcyl.framework.mybatis.core.mapper.BaseMapperX;
import cn.gcyl.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.gcyl.module.biz.controller.admin.collect.vo.*;
import cn.gcyl.module.biz.dal.dataobject.collect.CollectDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 收藏信息 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface CollectMapper extends BaseMapperX<CollectDO> {

    default PageResult<CollectDO> selectPage(CollectPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CollectDO>()
                .eqIfPresent(CollectDO::getId, reqVO.getId())
                .eqIfPresent(CollectDO::getModule, reqVO.getModule())
                .eqIfPresent(CollectDO::getTitle, reqVO.getTitle())
                .eqIfPresent(CollectDO::getId, reqVO.getId())
                .betweenIfPresent(CollectDO::getCollectTime, reqVO.getCollectTime())
                .orderByDesc(CollectDO::getId));
    }

}